home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 9
/
Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO
/
015a
/
el130.zip
/
ERRLEVEL.DOC
< prev
Wrap
Text File
|
1993-03-15
|
4KB
|
90 lines
ERRLEVEL
Batch File Errlevel Reporting Utility
─────────────────────────────────────
ERRLEVEL is a utility that simply executes another program and reports
the return code, or DOS errlevel, that is returned when the program
terminates. In addition to reporting the errlevel via the console,
ERRLEVEL returns the same errlevel return code itself. This means it
may be used virtually transparently in batch files.
ERRLEVEL only works with .COM and .EXE files. It will search the PATH
specified in the environment to find the file, just as COMMAND.COM
does. It cannot execute batch files and COMMAND.COM internal
commands, but they do not return an errlevel anyway. If desired,
ERRLEVEL can use a secondary command processor to process batch files
or execute internal commands. However, unless COMMAND.COM itself has
a problem running, the errlevel returned will always be zero.
SYNTAX
──────
ERRLEVEL [/nnn] <command-line>
The command-line to be executed should be entered exactly as it would
be directly from the COMMAND.COM prompt. Any switches entered prior
to the command-line will be parsed by ERRLEVEL.COM, not the command to
be executed. The only switch supported is a 1- to 3-digit decimal
number that may be used to force a specified errlevel to be returned
instead of just echoing the errlevel returned by the executed command.
To parse this switch, ERRLEVEL will normally use the leading forward
slash, but it does query DOS and will use any alternative switch
character that may have been specified, such as a dash.
An errlevel may be specified without a command-line, and that errlevel
will simply be echoed without attempting to execute any command-line
program. However, if no parameters of any type are entered, a brief
syntax help message is displayed. Alternatively, this message may be
displayed using the TYPE command, as follows:
TYPE ERRLEVEL.COM
The same message is also displayed if an incorrect errlevel switch is
entered, or if an error is encountered parsing it. If ERRLEVEL is
unable to find and/or execute the command-line, the following message
will be displayed:
Unable to execute program.
Any other errors in the command-line are not detectable by the
ERRLEVEL program, and any other error messages are the result of the
command-line program.
COPYRIGHT, LICENSE & WARRANTY
─────────────────────────────
Copyright (C) 1992 by William R. Peate
All rights reserved.
The program file ERRLEVEL.COM and this accompanying documentation are
copyrighted by the author. The copyright owner licenses anyone to
use, copy, and distribute this program and its documentation via any
means, electronic or otherwise, free of any and all charges.
The user or anyone else is specifically prohibited from charging or
requesting donations for any such copies, or for distribution by other
than electronic means, unless approved by prior permission. No person
or company may include this program or documentation along with or as
part of any commercial product, or any product for which charges are
made, without express permission from the copyright owner.
No copy of this program may be distributed by any means without this
accompanying document, and this notice shall not be removed.
The author makes no warranty of any kind, expressed or implied, and
will not be liable for any damages connected to or resulting from its
use. Use and/or distribution of this program and document
acknowledges the above copyright and license.
Questions and suggestions should be directed to the author:
William R. Peate
725 FM 1959 #913
Houston, TX 77034-5484
CompuServe: 76525,2366
BIX: bpeate